﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Libs.HR;

public partial class Pages_Hr_FileData_View : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        AppUtils.CheckLogin();
        var _FileData = new FileData() { FileID = AppUtils.Request("id") };
        _FileData = _FileData.Get();
        if (_FileData == null) return;
        Response.Clear();
        Response.ContentType = _FileData.FileType;
        Response.BinaryWrite(_FileData.Data);
        //Response.OutputStream.Write(_FileData.Data, 0, _FileData.Size);
        //Response.AppendHeader("Content-Disposition", String.Format("attachment; filename={0}", _FileData.FileName.Replace(" ", "-")));
        Response.End();
    }
}
